package IOStreamStudy.fileDo;

import org.junit.Test;

import java.io.File;
import java.io.IOException;


public class GetFileInformation {


    @Test
    public void readFileInfo() throws IOException {
        String path = "D:\\all_projects\\java_projects\\java_ij\\springMVC\\NetWork\\src\\cn\\usts\\edu\\IOStreamStudy\\a.txt";
        File file = new File(path);
        System.out.println(file.getAbsoluteFile());//绝对路径
        System.out.println(file.getParent()); // 获取父路径
        System.out.println(file.length());// 3+3*2
    }
}
